(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Rewrite Strategy: INNERMOST

(1) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

(2) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

p(0') → 0'
p(s(X)) → X
leq(0', Y) → true
leq(s(X), 0') → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0'n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0'
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

S is empty.
Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Innermost TRS:
Rules:
p(0') → 0'
p(s(X)) → X
leq(0', Y) → true
leq(s(X), 0') → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0'n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0'
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Types:
p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
0' :: n__0:n__p:n__diff:n__s
s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
leq :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → true:false
true :: true:false
false :: true:false
if :: true:false → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
activate :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__0 :: n__0:n__p:n__diff:n__s
n__s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
hole_n__0:n__p:n__diff:n__s1_3 :: n__0:n__p:n__diff:n__s
hole_true:false2_3 :: true:false
gen_n__0:n__p:n__diff:n__s3_3 :: Nat → n__0:n__p:n__diff:n__s

(5) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
leq, activate

They will be analysed ascendingly in the following order:
leq < activate

(6) Obligation:

Innermost TRS:
Rules:
p(0') → 0'
p(s(X)) → X
leq(0', Y) → true
leq(s(X), 0') → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0'n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0'
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Types:
p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
0' :: n__0:n__p:n__diff:n__s
s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
leq :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → true:false
true :: true:false
false :: true:false
if :: true:false → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
activate :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__0 :: n__0:n__p:n__diff:n__s
n__s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
hole_n__0:n__p:n__diff:n__s1_3 :: n__0:n__p:n__diff:n__s
hole_true:false2_3 :: true:false
gen_n__0:n__p:n__diff:n__s3_3 :: Nat → n__0:n__p:n__diff:n__s

Generator Equations:
gen_n__0:n__p:n__diff:n__s3_3(0) ⇔ n__0
gen_n__0:n__p:n__diff:n__s3_3(+(x, 1)) ⇔ n__s(gen_n__0:n__p:n__diff:n__s3_3(x))

The following defined symbols remain to be analysed:
leq, activate

They will be analysed ascendingly in the following order:
leq < activate

(7) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol leq.

(8) Obligation:

Innermost TRS:
Rules:
p(0') → 0'
p(s(X)) → X
leq(0', Y) → true
leq(s(X), 0') → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0'n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0'
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Types:
p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
0' :: n__0:n__p:n__diff:n__s
s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
leq :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → true:false
true :: true:false
false :: true:false
if :: true:false → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
activate :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__0 :: n__0:n__p:n__diff:n__s
n__s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
hole_n__0:n__p:n__diff:n__s1_3 :: n__0:n__p:n__diff:n__s
hole_true:false2_3 :: true:false
gen_n__0:n__p:n__diff:n__s3_3 :: Nat → n__0:n__p:n__diff:n__s

Generator Equations:
gen_n__0:n__p:n__diff:n__s3_3(0) ⇔ n__0
gen_n__0:n__p:n__diff:n__s3_3(+(x, 1)) ⇔ n__s(gen_n__0:n__p:n__diff:n__s3_3(x))

The following defined symbols remain to be analysed:
activate

(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
activate(gen_n__0:n__p:n__diff:n__s3_3(n27_3)) → gen_n__0:n__p:n__diff:n__s3_3(n27_3), rt ∈ Ω(1 + n273)

Induction Base:
activate(gen_n__0:n__p:n__diff:n__s3_3(0)) →RΩ(1)
gen_n__0:n__p:n__diff:n__s3_3(0)

Induction Step:
activate(gen_n__0:n__p:n__diff:n__s3_3(+(n27_3, 1))) →RΩ(1)
s(activate(gen_n__0:n__p:n__diff:n__s3_3(n27_3))) →IH
s(gen_n__0:n__p:n__diff:n__s3_3(c28_3)) →RΩ(1)
n__s(gen_n__0:n__p:n__diff:n__s3_3(n27_3))

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(10) Complex Obligation (BEST)

(11) Obligation:

Innermost TRS:
Rules:
p(0') → 0'
p(s(X)) → X
leq(0', Y) → true
leq(s(X), 0') → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0'n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0'
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Types:
p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
0' :: n__0:n__p:n__diff:n__s
s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
leq :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → true:false
true :: true:false
false :: true:false
if :: true:false → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
activate :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__0 :: n__0:n__p:n__diff:n__s
n__s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
hole_n__0:n__p:n__diff:n__s1_3 :: n__0:n__p:n__diff:n__s
hole_true:false2_3 :: true:false
gen_n__0:n__p:n__diff:n__s3_3 :: Nat → n__0:n__p:n__diff:n__s

Lemmas:
activate(gen_n__0:n__p:n__diff:n__s3_3(n27_3)) → gen_n__0:n__p:n__diff:n__s3_3(n27_3), rt ∈ Ω(1 + n273)

Generator Equations:
gen_n__0:n__p:n__diff:n__s3_3(0) ⇔ n__0
gen_n__0:n__p:n__diff:n__s3_3(+(x, 1)) ⇔ n__s(gen_n__0:n__p:n__diff:n__s3_3(x))

No more defined symbols left to analyse.

(12) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
activate(gen_n__0:n__p:n__diff:n__s3_3(n27_3)) → gen_n__0:n__p:n__diff:n__s3_3(n27_3), rt ∈ Ω(1 + n273)

(13) BOUNDS(n^1, INF)

(14) Obligation:

Innermost TRS:
Rules:
p(0') → 0'
p(s(X)) → X
leq(0', Y) → true
leq(s(X), 0') → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0'n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0'
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Types:
p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
0' :: n__0:n__p:n__diff:n__s
s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
leq :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → true:false
true :: true:false
false :: true:false
if :: true:false → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
activate :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__0 :: n__0:n__p:n__diff:n__s
n__s :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__diff :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
n__p :: n__0:n__p:n__diff:n__s → n__0:n__p:n__diff:n__s
hole_n__0:n__p:n__diff:n__s1_3 :: n__0:n__p:n__diff:n__s
hole_true:false2_3 :: true:false
gen_n__0:n__p:n__diff:n__s3_3 :: Nat → n__0:n__p:n__diff:n__s

Lemmas:
activate(gen_n__0:n__p:n__diff:n__s3_3(n27_3)) → gen_n__0:n__p:n__diff:n__s3_3(n27_3), rt ∈ Ω(1 + n273)

Generator Equations:
gen_n__0:n__p:n__diff:n__s3_3(0) ⇔ n__0
gen_n__0:n__p:n__diff:n__s3_3(+(x, 1)) ⇔ n__s(gen_n__0:n__p:n__diff:n__s3_3(x))

No more defined symbols left to analyse.

(15) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
activate(gen_n__0:n__p:n__diff:n__s3_3(n27_3)) → gen_n__0:n__p:n__diff:n__s3_3(n27_3), rt ∈ Ω(1 + n273)

(16) BOUNDS(n^1, INF)